package com.huawang.mdesign.model.service.util.reqif;

import com.huawang.mdesign.model.service.util.reqif.converter.DateConverter;
import com.huawang.mdesign.model.service.util.reqif.ref.AttributeDefinitionDateRef;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.annotations.XStreamOmitField;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * A date/time attribute value.
 *
 * @author xdl
 * @since 2023-04-04
 */
@Getter
@Setter
@XStreamAlias(ReqIFConstants.ATTRIBUTE_VALUE_DATE)
public class AttributeValueDate extends AbstractAttributeValueSimple {

    /**
     * The attribute value.
     */
    @XStreamAlias(ReqIFConstants.VALUE)
    @XStreamAsAttribute
    @XStreamConverter(DateConverter.class)
    private Date theValue;

    /**
     * Reference to the value definition.
     */
    @XStreamOmitField
    private AttributeDefinitionDate definition;

    @XStreamAlias(ReqIFConstants.DEFINITION)
    private AttributeDefinitionDateRef definitionRef;

    /**
     * Back linkage of the owning attribute definition
     */
    @XStreamOmitField
    private AttributeDefinitionDate owningDefinition;
}
